from random import randint


def redbag(total, n):
    money = []
    sum = 0
    for i in range(n - 1):
        x = randint(1, total - sum - (n - i))
        money.append(x)
        sum += x
    money.append(total - sum)
    print(money)


redbag(100, 10)
